<template>
  <!-- 内容审核页 -->
  <div
    class="content-check-wapper"
    v-loading="loading">
    <!-- 查询条件 -->
    <el-form
      :model="searchCondition"
      ref="activityView"
      class="el-row content-check-form">
      <!-- <el-form-item label="菜单名称" prop="activityName" class="el-col-10">
        <el-input v-model="searchCondition.activityName" @keyup.enter.native="handleSearch"></el-input>
      </el-form-item> -->
      <el-form-item
        label="审核状态"
        prop="activityStatus"
        class="el-col-10">
        <el-select
          v-model="searchCondition.activityStatus"
          clearable>
          <el-option
            label="待审核"
            value="0"/>
          <el-option
            label="已审核"
            value="1"/>
        </el-select>
      </el-form-item>
      <el-form-item class="el-col-5 btn-wapper">
        <el-button
          type="primary"
          @click="handleSearch">查询</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
    <!-- 数据列表 | 表格显示区 -->
    <div class="table-wapper">
      <el-table
        :data="tableMsg"
        tooltip-effect="light"
        border>
        <el-table-column
          align="center"
          type="index"
          label="序号"
          width="50"/>
        <el-table-column
          align="center"
          label="图片"
          width="200">
          <template slot-scope="scope">
            <img
              style="width: 160px;"
              :src="scope.row.url || 'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=123807196,3598291508&fm=26&gp=0.jpg'"
              alt="" >
          </template>
        </el-table-column>
        <el-table-column
          align="center"
          show-overflow-tooltip
          v-for="(item, index) in theadListDefault"
          :key="index"
          :width="item.width || 150"
          :prop="item.prop"
          :label="item.label"/>
        <el-table-column
          label="操作"
          align="center">
          <template slot-scope="scope">
            <span
              class="check-operate"
              :class="{active: item.active.includes(scope.row.state) && (item.key==='finish' ? scope.row.isActivityEnd==='Y' : true)}"
              v-for="item in operateOptions"
              v-if="item.show.includes(scope.row.state)"
              :key="item.value"
              @click="handleDetail(scope, item.key, item.active.includes(scope.row.state))">{{ item.label }}</span>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!-- pagination -->
    <div class="table-pagination">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="tablePage.currentPage"
        :page-sizes="[10, 20, 50, 100, 200]"
        :page-size="tablePage.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="tablePage.total" />
    </div>
  </div>
</template>

<script>
import mixinContextModule from '@/mixins/content-audit/content-check'
export default {
  mixins: [mixinContextModule],
  created () {
    this.initTableData()
  }
}
</script>

<style lang="scss" scoped>
.el-col-10 {
  .el-input {
    width: 250px;
  }
}
.check-operate {
  color: #ccc;
  margin: 0 5px;
  &.active {
    color: #7382FC;
    text-decoration: underline;
    cursor: pointer;
  }
}
</style>
